From c30073793edcf373abf4fe31d6b51ec921bd2016 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 30 Nov 2017 14:47:08 +0100 Subject: [PATCH] broadway: Improve logging We now log backwards, so that the latest is always visible. Also, we use
 with a smaller size.
---
 gdk/broadway/broadway.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index 5474960bc7..4e15ecd3ab 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -2,13 +2,14 @@
 var logDiv = null;
 function log(str) {
     if (!logDiv) {
-        logDiv = document.createElement('div');
+        logDiv = document.createElement('pre');
         document.body.appendChild(logDiv);
         logDiv.style["position"] = "absolute";
         logDiv.style["right"] = "0px";
+        logDiv.style["font-size"] = "small";
     }
-    logDiv.appendChild(document.createTextNode(str));
-    logDiv.appendChild(document.createElement('br'));
+    logDiv.insertBefore(document.createElement('br'), logDiv.firstChild);
+    logDiv.insertBefore(document.createTextNode(str), logDiv.firstChild);
 }
 
 function getStackTrace()
-- 
2.30.2